<!--#include file="AspCms_StyleFun.asp" -->
<%CheckAdmin("AspCms_Template.asp")%>
<!DOCTYPE html>
<html lang="zh-CN" style="min-height: 100%;">
<head>
<title>Template</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />

<link href="https://cdn.bootcss.com/uikit/3.0.0-beta.22/css/uikit.min.css" rel="stylesheet">
<link href="https://cdn.bootcss.com/jquery.perfect-scrollbar/0.7.0/css/perfect-scrollbar.min.css" rel="stylesheet">
<link href="../css/timoo/fancySelect.css" rel="stylesheet">
<link href="../css/timoo/timoo.css" rel="stylesheet">

<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/uikit/3.0.0-beta.22/js/uikit.min.js"></script>
<script src="https://cdn.bootcss.com/uikit/3.0.0-beta.22/js/uikit-icons.min.js"></script>
<script src="https://cdn.bootcss.com/jquery.perfect-scrollbar/0.7.0/js/perfect-scrollbar.jquery.min.js"></script>
<script src="../js/timoo/icheck.min.js"></script>
<script src="../js/timoo/fancySelect.js"></script>
<script src="../js/timoo/timoo.js"></script>
</head>
<body>
<div class="tm-right">
    <div class="main">
        <div class="section setting-company">
            <div class="layout">
                <div class="title">模板文件列表</div>
                <div class="content">
                    <div class="operation">
                        <ul class="uk-clearfix">
                            <li class="uk-float-left">
                                <input onClick="location.href='?acttype=html'" type="button" value="模板管理">
                            </li>
                            <li class="uk-float-left">
                                <input onClick="location.href='?acttype=css'" type="button" value="Css管理">
                            </li>
                            <li class="uk-float-left">
                                <input onClick="location.href='?acttype=wap'" type="button" value="wap模板管理">
                            </li>
                            <li class="uk-float-left catalog">
                                <span class="subject">所在目录：</span>
                                <span class="text">
                                    <%
                                       if acttype="css" then 
                                           echo sitePath&"/Templates/"&setting.defaultTemplate&"/"&"css"
                                       elseif acttype="wap" then 
                                           echo sitePath&"/Templates/"&setting.defaultTemplate&"/"&"wap"
                                       else
                                           echo sitePath&"/Templates/"&setting.defaultTemplate&"/"&setting.htmlFilePath	
                                       end if
                                    %>
                                </span>
                            </li>
                            <li class="uk-float-right">
                                <input onClick="location.href='<%=getPageName()%>'" type="button" value="刷新"> 
                            </li>
                            <li class="uk-float-right">
                                <input onClick="location.href='AspCms_TemplateAdd.asp?acttype=css'" type="button" value="添加Css"> 
                            </li>
                            <li class="uk-float-right">
                                <input onClick="location.href='AspCms_TemplateAdd.asp?acttype=html'" type="button" value="添加模板">
                            </li>
                        </ul>
                    </div>
                    <form action="?action=delallfile" method="post" name="form">
                        <div class="uk-text-center table">
                            <table class="uk-table uk-table-divider">
                                <thead>
                                    <tr>
                                        <th>选择</th>
                                        <th>编号</th>
                                        <th>文件名称</th>
                                        <th>大小</th>
                                        <th>描述</th>
                                        <th>修改日期</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <%
                                       fileList acttype
                                       Sub fileList(acttype)
                                       dim path,fileListArray,i,fileAttr,folderListArray,folderAttr,parentPath
                                       
                                       if acttype="css" then 
                                           path=sitePath&"/Templates/"&setting.defaultTemplate&"/"&"css"
                                       elseif acttype="wap" then 
                                           path=sitePath&"/Templates/"&setting.defaultTemplate&"/"&"wap/"
                                           nametype="wap"
                                       else
                                           path=sitePath&"/Templates/"&setting.defaultTemplate&"/"&setting.htmlFilePath	
                                       end if
                                       
                                       if not isExistFolder(path) then createFolder path,"folderdir"
                                       
                                       if not isnul(getForm("dirpath","get")) then
                                           path=getForm("dirpath","get")
                                           parentPath=Mid(getForm("dirpath","get"),1,InstrRev(getForm("dirpath","get"),"/")-1)
                                       end if
                                       
                                       if not isExistFolder(path) then	
                                           echo "<tr><td colspan='7' class='no-data'>没有这个目录<a href='javascript:history.go(-1)'>返回</a></td></tr>"
                                           response.end
                                       end if
                                       
                                       fileListArray= getFileList(path)
                                       
                                       if instr(fileListArray(0),",")>0 then
                                           for  i = 0 to ubound(fileListArray)
                                               fileAttr=split(fileListArray(i),",")
                                               echo "<tr>"
                                               echo "<td class='input'><div class='label-box'><label for='Num"&i+1&"' class='uk-clearfix uk-float-left tm-transition'><span class='uk-float-left check check-select'><i class='tm-transition icon' uk-icon='icon: check'></i></span><input id='Num"&i+1&"' class='select' type='checkbox' value='"&fileAttr(0)&"' name='filename'></label></div></td>"
                                               echo "<td>"&i+1&"</td>"
                                               echo "<td>"&fileAttr(0)&"</td>"
                                               echo "<td>"&fileAttr(2)&"</td>"
                                               echo "<td>"&GetDescFromConfig(sitePath&"/Templates/"&setting.defaultTemplate,fileAttr(0))&"</td>"
                                               echo "<td>"&FormatDate(fileAttr(3), "yy-m-d h:mi:s")&"</td>"
                                               echo "<td class='uk-flex uk-flex-center uk-text-center control'><ul class='uk-clearfix'><li class='uk-float-left'><a href='AspCms_TemplateEdit.asp?acttype="&acttype&"&filename="&fileAttr(0)&"'>编辑</a></li><li class='uk-float-left'><a href='?acttype="&acttype&"&action=del&filename="&fileAttr(0)&"' onClick='return confirm('确定要删除吗')'>删除</a></li></ul></td>"
                                               echo "</tr>"
                                            next
                                        end if
                                        
                                        if not instr(fileListArray(0),",")>0 then
                                            echo "<tr><td colspan='7' class='no-data'>空文件夹<a href='javascript:history.go(-1)'>返回</a></td></tr>"
                                        end if
                                        
                                        End Sub
                                    %>
                                </tbody>
                            </table>
                            <div class="uk-clearfix input table-foot">
                                <label for="Select-All" class="uk-clearfix uk-float-left tm-transition">
                                    <span class="uk-float-left check">
                                        <i class="tm-transition icon" uk-icon="icon: check"></i>
                                    </span>
                                    <span class="uk-float-left">全选</span>
                                    <input id="Select-All" type="checkbox" value="1">
                                </label>
                                <label for="Select-Reverse" class="uk-clearfix uk-float-left tm-transition">
                                    <span class="uk-float-left check">
                                        <i class="tm-transition icon" uk-icon="icon: check"></i>
                                    </span>
                                    <span class="uk-float-left">反选</span>
                                    <input id="Select-Reverse" type="checkbox" value="1">
                                </label>
                                <div class="uk-clearfix uk-float-left input-list">
                                    <ul class="uk-clearfix">
                                        <li class="uk-float-left">
                                            <input type="submit" value="删除" onClick="if(confirm('确定要删除吗')){form.action='?acttype=<%=acttype%>&action=del';}else{return false};"> 
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>